﻿using System.IO;
using System.Reflection;
using System.Windows;
using Infrastructure;
using Microsoft.Practices.Prism.Logging;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Unity;
namespace PrismPasswordGenerator
{
    public class Bootstrapper : Microsoft.Practices.Prism.UnityExtensions.UnityBootstrapper
    {
        protected override DependencyObject CreateShell()
        {
            return Container.Resolve<Shell>();
        }
        protected override void InitializeShell()
        {
            base.InitializeShell();
            Application.Current.MainWindow = (Window)Shell;
            Application.Current.MainWindow.Show();
        }
        protected override IModuleCatalog CreateModuleCatalog()
        {
            DirectoryModuleCatalog dmc = new DirectoryModuleCatalog { ModulePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) };
            return dmc;
        }
        protected override ILoggerFacade CreateLogger()
        {
            return  new BareBonesLoggerAdapter();
        }
    }
}
